<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="com.ereport.entity.Expenses"%>
<%@page import="java.text.DateFormat"%>
<%@page import="com.ereport.entity.DailyActivity"%>
<%@page import="java.util.List"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<link href="<%=application.getContextPath() %>/css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=application.getContextPath() %>/js/jquery-1.6.min.js"></script>	
<script language="javascript" src="<%=application.getContextPath() %>/js/calendar_eu.js"></script>
<script type="text/javascript" src="<%=application.getContextPath() %>/js/jquery-ui-1.8.17.custom.min.js"></script>	
<link rel="stylesheet" href="<%=application.getContextPath() %>/css/jquery-ui-1.8.17.custom.css"/>
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
<script type="text/javascript">
$(document).ready(function(){
	<%
	String year="";
	if(session.getAttribute("year")!=null){
	  year=session.getAttribute("year").toString();
	  session.setAttribute("year",null);
	}
	String mnth="";
	if(session.getAttribute("mnth")!=null){
	  mnth=session.getAttribute("mnth").toString();
	  session.setAttribute("mnth",null);
	}
	%>
	$("#year").val("<%=year%>");
	$("#mnth").val("<%=mnth%>");
	
});
</script>
</head>
<style>
	#editor{
	width:95%;
	}
	#remarksEditor{
	width:95%;
	}
	#nextsteppopup {
	position:absolute;
  z-index:200; /* aaaalways on top*/
  padding: 3px;
 
  width: 250px;
  color: white;
	}
	.ui-dialog .ui-state-error { padding: .3em; }
	.ui-corner-all{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	color: #666666;
	text-decoration: none;
	}
	.ui-corner-all:hover{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	color: #666666;
	text-decoration: none;
	}
	.logout{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	height: 15px;
	width: 50px;
	font-weight: normal;
	color: red;
	text-decoration: none;
	}
	#bulletinDialog title{
	font-family:Arial, Helvetica, sans-serif;
	font-size:14px;
	font-weight:bold;
	}
	.tdinput{
	text-align: center;
	}
	.textfield{
	height:25px;
	}
	</style>
  <script>

	$(function() {
		$( "#dailyDate" ).datepicker({ dateFormat: "dd-mm-yy" });
	});
	</script>
<body onload="MM_preloadImages('<%=application.getContextPath() %>/images/mb-hover.jpg','<%=application.getContextPath() %>/images/bp-hover.jpg','<%=application.getContextPath() %>/images/sp-hover.jpg')">
<form action="<%=application.getContextPath()%>/conveyExpdture/getExpReport.do" method="post" name="myform">
<table width="927" style="height:880px" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="116" align="left" valign="top" background="<%=application.getContextPath() %>/images/top-bg.jpg" style="background-repeat:repeat-x; background-position:left top">
    <%@ include file="common/exe-header.jsp" %></td>
  </tr>
  <tr>
    <td align="left" valign="top" height="30px">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    	<tr>
    		<td align="left" valign="top">&nbsp;&nbsp;
    			<a href="<%=application.getContextPath() %>/user/open.do"><img src="<%=application.getContextPath() %>/images/home1.jpg" width="20" height="20" border="0" /></a>    		</td>
    	<td align="center" valign="top">
    	<%
        if(request.getParameter("success")!=null){
        	out.println(request.getParameter("success"));
        }
        %>    	</td>
    	<td width="8%" align="center"><a href="<%=application.getContextPath() %>/user/logout.do" style="font-family: sans-serif;">&nbsp;&nbsp;Logout</a></td>
    	</tr>
    </table>    </td>
  </tr>
  <tr>
    <td  align="left" height="150" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="23%"  align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="5%">&nbsp;</td>
            <td width="95%"><a href="<%=application.getContextPath() %>/DailyCallReport/open.do" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','<%=application.getContextPath() %>/images/dailycall-hover.jpg',1)"><img src="<%=application.getContextPath() %>/images/dailycall-active.jpg" name="Image2" width="190" height="58" border="0" id="Image2" /></a></td>
            </tr>
          <tr>
            <td>&nbsp;</td>
            <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','<%=application.getContextPath() %>/images/convExp-hover.jpg',1)"><img src="<%=application.getContextPath() %>/images/convExp-hover.jpg" name="Image3" width="190" height="62" border="0" id="Image3" /></a></td>
            </tr>
          <tr>
            <td>&nbsp;</td>
            <td><a href="<%=application.getContextPath() %>/businessReport/open.do" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','<%=application.getContextPath() %>/images/busReport-hover.jpg',1)"><img src="<%=application.getContextPath() %>/images/busReport-active.jpg" name="Image4" width="190" height="57" border="0" id="Image4" /></a></td>
            </tr>
        </table></td>
        <td width="76%" valign="top"><table width="100%" height="177" cellpadding="0" cellspacing="0" bordercolor="#F0F0F0" class="box-border1">
          <tr>
            <td width="99%" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      
       <tr>
        <td>&nbsp;</td>
        <td align="center"></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="20">&nbsp;</td>
        <td align="center" valign="top" class="heading">Conveyance Expenditure </td>
        <td width="20">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"></td>
        <td>&nbsp;</td>
      </tr>
     
      <tr>
        <td >&nbsp;</td>
        <td align="center">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        	<tr>
        		<td width="1%"   align="center"></td>
        		<td align="left" width="12%"> 
        		<select name="month" class="textfield" id="mnth" style="width: 90px" >
        	
                          <option value="">Month</option>
                          <option value="01">Jan</option>
                          <option value="02">Feb</option>
                          <option value="03">Mar</option>
                          <option value="04">Apr</option>
                          <option value="05">May</option>
                          <option value="06">Jun</option>
                          <option value="07">Jul</option>
                          <option value="08">Aug</option>
                          <option value="09">Sep</option>
                          <option value="10">Oct</option>
                          <option value="11">Nov</option>
                          <option value="12">Dec</option>
                      </select> 
           		</td>
           		
           		<td class="hed-blc" width="17%" align="center">
           		<select name="year" id="year" class="textfield" style="width: 90px" >
           		
        			      <option value="">Year</option>
                      	  <option value="2012">2012</option>
                          <option value="2013">2013</option>
                          <option value="2014">2014</option>
                          <option value="2015">2015</option>
                          <option value="2016">2016</option>
                          <option value="2017">2017</option>
                          <option value="2018">2018</option>
                          <option value="2019">2019</option>
                          <option value="2020">2020</option>
                          <option value="2021">2021</option>
                          <option value="2022">2022</option>
                      </select></td>
        		<td width="70%">
        			<input type="submit" name="go" value="GO" class="button-black" style="width: 37px; height: 25px; font-size: 11px; margin-left: 5px; "/>        		</td>
        	</tr>
        </table>       </td>
        <td>&nbsp;</td>
      </tr>
       <tr>
        <td>&nbsp;</td>
        <td align="center">       </td>
        <td>&nbsp;</td>
      </tr>
       <tr>
        <td>&nbsp;</td>
        <td align="center"></td>
        <td>&nbsp;</td>
      </tr>
       <tr>
        <td>&nbsp;</td>
        <td align="center"></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="7px"></td>
        <td align="center" valign="top" height="7px"></td>
        <td height="7px"></td>
      </tr>
      
      
    </table></td>
          </tr>
        </table></td>
        <td width="3%" valign="top">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td align="left" height="10px" valign="top">&nbsp;
       </td>
  </tr>
  <tr>
    <td align="center"  valign="top"><%
        List<Expenses> expList=(List<Expenses>)session.getAttribute("expList");
        System.out.println("dalist in jsp "+expList);
        if(expList!=null){
        	if(expList.size()!=0){
        		System.out.println("dalist size is "+expList.size());
        %>
        <div id="convExpditure">
          <table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="left" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#787878" class="tablebox" id="infoTable">
                        <tr style="background:url('<%=application.getContextPath() %>/images/hed-bg-block-2.jpg'); background-repeat:repeat-x; background-position:left top">
                          <td width="43" height="30" align="center" valign="middle" class="hed"><strong>Sr.No </strong></td>
                          <td width="168" align="center" valign="middle" class="hed">Travel Expenses</td>
                          <td width="149" align="center" valign="middle" class="hed">Hotel</td>
                          <td width="140" align="center" valign="middle" class="hed"><strong>Entertainment </strong></td>
                          <td width="144" align="center" valign="middle" class="hed"><strong>Mobile</strong></td>
                          <td width="128" align="center" valign="middle" class="hed"><strong>Others</strong></td>
                          <td width="86" align="center" valign="middle" class="hed"><strong>Date</strong></td>
                         
                          <!-- <td width="4%" align="center" valign="middle" class="hed">&nbsp;</td>  -->
                        </tr>
                        <%
                        float travel=0;
                        float hotel=0;
                        float entrtment=0;
                        float others=0;
                        float mbl=0;
                        String dt="";
                        
                  for(int i=0;i<expList.size();i++){
                	  
                	  float tr=expList.get(i).getTravel();
                	  float ht=expList.get(i).getHotel();
                	  float entr=expList.get(i).getEntertainment();
                	  float other=expList.get(i).getOthers();   
                	  float mb=expList.get(i).getSpend();
                	  Date dat=expList.get(i).getExpdate();
                      DateFormat dfmt=new SimpleDateFormat("dd-MM-yyyy");
                      	dt=dfmt.format(dat.getTime());
                  %>
                        <tr>
                          <td align="center" bgcolor="#cccccc"><%=i+1%></td>
                          <td bgcolor="#cccccc"><input name="org1" class="tdinput" id="org1" type="text" value="<%=tr%>" readonly="readonly" />
                          </td>
                          <td bgcolor="#cccccc"><input name="disig1" class="tdinput" id="disig" type="text" size="8" value="<%= ht%>" readonly="readonly"/>
                          </td>
                          <td bgcolor="#cccccc"><input name="contper1" class="tdinput" id="contper1" type="text" size="8" value="<%=entr%>" readonly="readonly"/>
                          </td>
                          <td  align="center" bgcolor="#cccccc"><input name="contper1" class="tdinput" id="contper1" type="text" size="8" value="<%=mb%>" readonly="readonly"/></td>
                          <td width="128" bgcolor="#cccccc"><input type="text" class="tdinput" name="vistObj1" id="visitObjpop1" size="8"  value="<%=other%>" readonly="readonly"/>
                          </td>
                          <td width="86" bgcolor="#cccccc"><input type="text" class="tdinput" name="vistObj1" id="visitObjpop1" size="8"  value="<%=dt %>" readonly="readonly"/>
                          </td>
                         
                        </tr>
                        <%
                        travel=travel+tr;
                        hotel=hotel+ht;
                        entrtment=entrtment+entr;
                        others=others+other;
                        mbl=mbl+mb;
                  }
                        
				%>
					
				<tr>
                          <td align="center" bgcolor="#cccccc"><strong>Total</strong></td>
                          <td align="center" bgcolor="#cccccc">
                          <strong><%=travel %></strong>
                          </td>
                          <td align="center" bgcolor="#cccccc">
                          <strong> <%=hotel %></strong>
                          </td>
                          <td align="center" bgcolor="#cccccc">
                          <strong> <%=entrtment%></strong>
                          </td>
                          <td  align="center" bgcolor="#cccccc">
                          <strong><%=mbl%></strong>
                          </td>
                          <td align="center" width="128" bgcolor="#cccccc">
                          <strong> <%=others %></strong>
                          </td>
                          <td align="center" width="86" bgcolor="#cccccc">
                          
                          </td>
                         
                        </tr>
                    </table></td>
                  </tr>
                 
              </table></td>
            </tr>
            
           
          </table>
        </div>
      <%
        
        }else {
        %>
         <table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="center" valign="top">
        <p class="box-border1 hed-blc" style="font-size: 13px" > No Records Found</p>
        </td>
        </tr>
        </table>
      <%
        }
        	session.setAttribute("expList",null);
        }
		%>
    </td>
  </tr>
  <tr>
    <td height="40" align="left" valign="top" bgcolor="#0B0B0B">&nbsp;</td>
  </tr>
</table>
</form>
</body>
</html>
